// 定义的 layout页面的菜单信息
let menuArr = [
  {
    path: "/home",
    name: "首页",
    component: () => import("../views/HomeView.vue"),
    meta: { requireLogin: true, title: "首页", icon: "House" }
  },
  {
    path: "/ProductManager",
    name: "商品管理",
    meta: { icon: "message", title: "商品管理" },
    redirect: "/ProductManager/list",
    children: [
      {
        path: "/ProductManager/list",
        name: "商品列表",
        component: () => import("../views/ProductManager.vue"),
        meta: { requireLogin: true, title: "商品列表", icon: "House" }
      },
      {
        path: "/ProductManager/add",
        name: "商品添加",
        component: () => import("../views/ProductAddView.vue"),
        meta: { requireLogin: true, title: "商品添加", icon: "House" },
        children: [
          // {
          //   path: "/ProductManager/add/aaa",
          //   name: "商品aaa",
          //   component: () => import("../views/ProductAddView.vue"),
          //   meta: { requireLogin: true, title: "商品aa", icon: "House" }
          // }
        ]
      }
    ]
  },
  {
    path: "/SwiperManager",
    name: "轮播图管理",
    component: () => import("../views/SwiperManager.vue"),
    meta: { requireLogin: true, title: "轮播图管理", icon: "House" }
  },
  {
    path: "/AdminManager",
    name: "管理员管理",
    component: () => import("../views/AdminManager.vue"),
    meta: { requireLogin: true, title: "管理员管理", icon: "House" }
  }
];

// 定义的所有的路由信息
let routeArr = [
  {
    path: "/login",
    name: "登录",
    component: () => import("../views/LoginView.vue")
  },
  {
    path: "/",
    name: "layout",
    component: () => import("../views/Layout.vue"),
    redirect: "/home",
    meta: { requireLogin: true },
    //layout程序 主体--页面  点击侧边栏 切换 右侧的内容
    // children: [...menuArr]
    children: [...menuArr]
  },
  { path: "/:pathMatch(.*)*", name: "404", component: () => import("../views/NotFound.vue") }

  // {
  //   path: "/about",
  //   name: "about",
  //   component: () => import("../views/AboutView.vue")
  // }
];

export default routeArr;

export { menuArr };
